class Photo < ActiveRecord::Base
  cattr_reader :per_page, :upload_amount
  @@per_page = 10
  @@upload_amount = 5

  belongs_to :user
  has_many :comments, :class_name => "PhotoComment", :dependent => :destroy
  belongs_to :event
  belongs_to :school
  belongs_to :student
  has_attachment :processor => :rmagick,
                 :content_type => :image,
                 :storage => :s3,
                 :max_size => 2.megabytes,
                 :thumbnails => { :square => "75x75!",
                                  :thumb => "120x80>",
                                  :small => "240x180>",
                                  :medium => "565x420>" }
  validates_as_attachment
  
  def editable_by?(user)
    user!=:false && user.id == user_id
  end
end
